<template>
  <el-card
    class="box-card re-soft"
    shadow="hover"
    :body-style="{ padding: '0px' }"
  >
    <template #header>
      <div class="rjfl">
        <span class="rjfl-title">相关资源</span>

        <!-- 
        span class="rjfl-more"
          >更多
          
        </span>
         -->
      </div>
    </template>

    <div class="re-list">
      <div class="re-list-it" v-for="(it, i) in data" :key="i">
        <div class="re-left" @click="gotoDetail(it, $router, axios)">
          <img :src="it.icon" />
        </div>

        <div class="re-center" @click="gotoDetail(it, $router, axios)">
          <span class="name">{{ it.name }}</span>
          <div class="flex">
            <span class="star">
              <el-rate
                v-model="it.recommendIndex"
                disabled
                text-color="#ff9900"
              >
              </el-rate>
            </span>
          </div>
          <div class="flex">
            <span class="size">{{ it.downCount }}下载</span>
            <span class="size">{{ it.size }}</span>
          </div>
        </div>

        <div class="re-right" @click="gotoDetail(it, $router, axios)">
          <button
            class="button is-theme-button-hard is-rounded"
            style="height: 24px"
            @click.stop="downloadUrl(it.highSpeedUrlOne,it.id)"
          >
            下载
          </button>
        </div>
      </div>
    </div>
  </el-card>
</template>

<script setup>
import { ref } from "vue";

defineProps({
  data: {
    type: Array,
    default: () => [],
  },
});
</script>

<style lang="less" scoped>
.re-soft {
  .re-top {
    img {
      height: 80px;
      width: 100%;
      object-fit: cover;
    }
  }

  .re-list {
    display: flex;
    flex-direction: column;
    padding: 10px;

    &-it {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin: 0px 10px;
      height: 73.3px;
      cursor: pointer;
      .re-left {
        img {
          width: 64px;
          height: 64px;
        }
      }

      &:hover img {
        width: 70px;
        height: 70px;
        transition: all 0.1s;
      }

      .re-center {
        margin-left: 10px;
        flex: 1;

        .flex {
          display: flex;
          align-items: center;
          /deep/.el-rate__icon {
            margin-right: 0px !important;
            size: 10px;
          }
        }

        .name {
          font-size: 14px;
          font-weight: 400;
          color: #1d2127;
          line-height: 14px;
        }

        .size {
          height: 20px;
          margin-right: 5px;
          margin-top: 3px;
          font-size: 12px;
          font-weight: 400;
          color: #93999e;
          line-height: 20px;
        }
      }
    }
  }
}
</style>
